<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>商品分类</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript">
		window.jQuery || document.write("<script src='${pageContext.request.contextPath}/assets/js/jquery-2.0.3.min.js'>"+"<"+"/script>");
	</script>
	
	<script src="assets/js/jquery.min.js"></script>
	
	<link href="${pageContext.request.contextPath}/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
    <link href="${pageContext.request.contextPath}/css/style.css" rel="stylesheet" type="text/css"/>       
    <link href="${pageContext.request.contextPath}/assets/css/codemirror.css" rel="stylesheet" type="text/css">
    <link href="${pageContext.request.contextPath}/assets/css/ace.min.css" rel="stylesheet" type="text/css"/>
    <link href="${pageContext.request.contextPath}/Widget/zTree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet" type="text/css">
    <link href="${pageContext.request.contextPath}/assets/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
    <style>
    	li{
    		display:block;
    		width:auto;
    		height:30px;
    		border:1px solid rgba(60,70,190,0.2);
    		border-right:0;
    		border-top:0;
    		font-size: 13px;
    		color: #908047;
    		padding-top: 5px
    	}
    </style>
  </head>
  
  <body>
    <div class="clearfix" style="background-color: white">
 	  <div id="category">
        <div id="scrollsidebar" class="left_Treeview">
    	  <div class="show_btn" id="rightArrow"><span></span>
    	  </div>
   		  <div class="widget-box side_content" style="background-color: white">
   		    <div class="side_title">
   		  	  <a title="隐藏" class="close_btn"><span></span></a>
   		  	</div>
    		<div class="side_list">
     		  <div class="widget-header header-color-green2">
         		<h4 class="lighter smaller">商品类型列表</h4>
     		  </div>
     		  <div class="widget-body">
         		<div class="widget-main padding-8" style="background-color: rgba(220,255,255,1)">
             	  <div class="ztree" style="background-color: rgba(200,255,255,1);height:20px">
             	  </div>
         		</div>
         		<!--树-->
         		<div style="background-color: #000099">
         		  <div style="background-color: rgba(234,234,234,0.9)" id="typelist">
             	  	<c:if test="${list_gt!=null && list_gt.size()>0}">
	           	  	  <ul>
	            	  	<c:forEach items="${list_gt}" var="t" varStatus="ss">					
						  <li style="<c:choose><c:when test="${t.good_level==1}">background-color: rgba(230,230,180,0.9)</c:when>
						  		<c:when test="${t.good_level==2}">background-color: rgba(230,240,200,0.9)</c:when></c:choose>"
						  		class="level${t.good_level}">
						    <c:if test="${t.good_level>1}">
							    <c:forEach begin="0" end="${t.good_level}" step="1">&nbsp;&nbsp;</c:forEach>
							</c:if>
								<c:if test="${t.good_level>1}"> Lv${t.good_level}&nbsp;</c:if>${t.name}
						  </li>
						</c:forEach>
	           	  	  </ul>
             	  	</c:if>
             	  </div>
             	</div>
 			  </div>
  			</div>
  		  </div>  
  		</div>
  		<input type="hidden" name="opr">
 		<iframe id="testIframe" name="testIframe" frameborder=0 scrolling="auto" src="${pageContext.request.contextPath}/goodsTypeServlet?opr=toupdate" class="page_right_style"></iframe>
 	  </div>
	</div>
  </body>
  <script type="text/javascript">
	$(".widget-box").height($(window).height()); 
	$(".page_right_style").width($(window).width()-220);
	
	$(window).resize(function(){
		$(".widget-box").height($(window).height());
	 	$(".page_right_style").width($(window).width()-220);
	});
	var x=$(".widget-box").css("border");
	$(".close_btn").bind("click",function(){
		$("#scrollsidebar").animate({width:"0"},1000);
		$(".widget-box").css("background-color","white");
		$(".widget-box").css("border","0");
		$(".side_list").hide(1000);
		$(".show_btn").show(1400);
	});
	$(".show_btn").bind("click",function(){
		$("#scrollsidebar").animate({width:"220"},1000);
		$(".widget-box").css("background-color","white");
		$(".widget-box").css("border",x);
		$(".side_list").show();
		$(".show_btn").hide();
	});
	$.each($("li"),function(){
		$(this).bind("mouseover",function(){
			var str = $(this).text();
			var nstr = "☞"+str;
			$(this).text(nstr);
		});
	});
	$.each($("li"),function(){
		$(this).bind("mouseleave",function(){
			var str = $(this).text().replace("☞","");
			$(this).text(str);
		});
	});
	$.each($("li"),function(){
		$(this).bind("click",
			function(){
				var cname = $(this).attr("class");
				var cname2='level'+(parseInt(cname.replace("level",""))-1);
				if(($('.'+cname2).length)&&($('.'+cname2).length>0)){
					var cname3='level'+(parseInt(cname.replace("level",""))+1);
					if(($('.'+cname3).length)&&($('.'+cname3).length>0)){
						if($('.'+cname2).css("display")=='block'){
							$(this).css("display", "none");
							$('.'+cname3).css("display","none");
						}
					}
				}
				else
					$(this).css("display", "block");
			}
		);
	});
</script>
</html>
